<template>
    <el-form :model="loginFormData" status-icon :rules="validateRules" ref="loginForm"
             label-width="50px" class="login-form">
        <el-form-item label="邮箱" prop="email">
            <el-input type="email" v-model="loginFormData.email" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
            <el-input type="password" v-model="loginFormData.password" autocomplete="off"></el-input>
        </el-form-item>
    </el-form>
</template>

<script>
import commonValidateRules from "@/assets/utils/elFormValidate"

export default {
    name: "LoginForm",
    data() {
        return {
            loginFormData: {
                email: "",
                password: ""
            },
            validateRules: {
                ...commonValidateRules
            }
        }
    },
    methods: {
        async getFormJSON() {
            // 对表单进行完整校验
            await this.$refs.loginForm.validate()
            return JSON.stringify(this.loginFormData)
        }
    }
}
</script>

<style scoped>

.login-form {
    font-family: 'huyou', serif;
    font-weight: bolder;
}

/* label标签 */
/deep/ .el-form-item__label {
    font-size: 17px;
}

/* 校验失败提示信息 */
/deep/ .el-form-item__error {
    font-size: 15px;
}

</style>
